﻿@{
    var backurl = "/";
    if (!string.IsNullOrEmpty(Request["Back"]))
    {
        backurl = Request["Back"];
    }
    else
    {
        if (!string.IsNullOrEmpty(ViewBag.Back))
        {
            backurl = ViewBag.Back;
        }
    }
}
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Page-Enter" contect="revealTrans(duration=10,transtion= 6)">
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <meta name="viewport" content="width=device-width" />

    <style type="text/css">
        @@-webkit-keyframes fadeIn {
            0% {
                opacity: 0; /*初始状态 透明度为0*/
            }

            50% {
                opacity: 0.4; /*中间状态 透明度为0*/
            }

            100% {
                opacity: 1; /*结尾状态 透明度为1*/
            }
        }

        body {
            width: 100%;
            -webkit-animation-name: fadeIn; /*动画名称*/
            -webkit-animation-duration: 1s; /*动画持续时间*/
            -webkit-animation-iteration-count: 1; /*动画次数*/
            -webkit-animation-delay: 0s; /*延迟时间*/
        }

        .ui-header {
            position:fixed !important;
            width:100%;
            z-index:99999;
        }
        .ui-content {
            margin-top:44px;
        }
    </style>
    @*    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />*@

    <meta content="yes" name="apple-mobile-web-app-capable" />

    <meta content="black" name="apple-mobile-web-app-status-bar-style" />

    <meta content="telephone=no" name="format-detection" />

    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />


    @Scripts.Render("~/bundles/modernizr")
    <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
    <div id="pageframe" style="display: none;" data-role="page" data-theme="a">
        <div data-role="header">
            @if (IsSectionDefined("Header"))
            {
                @RenderSection("Header")
            }
            else
            {
                <a data-iconpos="left"  class="ui-btn-left" data-role="button" data-corners="false" data-icon="carat-l" 
                    data-shadow="false" data-wrapperels="span" href="@(backurl)">返回</a>
                <h2>@ViewBag.Title</h2>
                <a data-iconpos="notext" data-role="button" data-corners="false" data-icon="home" data-shadow="false" data-wrapperels="span" href="/">菜单</a>
                
            }
        </div>
        <div data-role="content">
            @RenderBody()
        </div>


    </div>


    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" />
    @Styles.Render("~/Content/mobileCss", "~/Content/css")





    <script type="text/ecmascript">
        //$(function () {
        //    $(".ui-header").css("width", "100%");
        //});
        $(document).on("mobileinit", function () {
            $.mobile.ajaxEnabled = false;
            $("#pageframe").show();
        });
        //$(document).on('pagebeforeshow', function () {

        //});
    </script>
    <script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>

    @RenderSection("scripts", required: false)
    <div style="display: none; width: 0px; height: 0px;">
        <iframe src="/CacheLinker.html" width="0" height="0"></iframe>
    </div>
</body>
</html>
